import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  
   {
    title: '变更类型',
    align:"center",
    dataIndex: 'changeType',
    sorter: {
            multiple: 3,
          },
    filters: [
        { text: '新增', value: 'n' },
        { text: '修改', value: 'u' },
        { text: '删除', value: 'd' },
    ],
    customRender: ({ record }) => {
      return record.changeType ? (record.changeType == 'n' ? '新增' :record.changeType == 'u'? '修改':'删除') : '';
    },
   },
   {
    title: '原规则名称',
    align:"center",
    dataIndex: 'oldRuleName'
   },
   {
    title: '新规则名称',
    align:"center",
    dataIndex: 'newRuleName'
   },
   {
    title: '原调度类型',
    align:"center",
    dataIndex: 'oldRuleType',
    customRender: ({ record }) => {
      return record.oldRuleType ? (record.oldRuleType == 'w' ? '按周' :'按日') : '';
    },
   },
   {
    title: '新调度类型',
    align:"center",
    dataIndex: 'newRuleType',
    customRender: ({ record }) => {
      return record.newRuleType ? (record.newRuleType == 'w' ? '按周' :'按日') : '';
    },
   },
   {
    title: '创建日期',
    align:"center",
    dataIndex: 'createTime',
    sorter: true,
   },
  //  {
  //   title: '原设备',
  //   align:"center",
  //   dataIndex: 'oldDev'
  //  },
  //  {
  //   title: '新设备',
  //   align:"center",
  //   dataIndex: 'newDev'
  //  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "变更类型",
      field: 'changeType',
      component: 'JSelectInput',
      componentProps: {
        options: [
          { label: '新增', value: 'n' },
          { label: '修改', value: 'u' },
          { label: '删除', value: 'd' },
        ],
      },
 	},
  {
   label:'原规则名称',
   field: 'oldRuleName',
   component: 'Input',
  },
  {
    label: "变更时间",
    field: "createTime",
    component: 'RangePicker',
    componentProps: {
        valueType: 'Date',
    },
  },
];




